package com.guaju.yueshangLife.base;

import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v4.app.FragmentActivity;

import com.guaju.yueshangLife.activity.NetErrorActivity;
import com.guaju.yueshangLife.global.BaseApplication;
import com.guaju.yueshangLife.net.NetworkUtil;
import com.guaju.yueshangLife.utils.AppManager;

public class BaseFragmentActivity extends FragmentActivity {

    @Override
    public void onCreate( Bundle savedInstanceState,  PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        AppManager.getAppManager().addActivity(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }
    public void showNetError() {
        if (!NetworkUtil.isConnected(this)&& (!BaseApplication.getInstance().isFinishable())) {
            startActivity(new Intent(this, NetErrorActivity.class));
        }
    }

}
